package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.face.FaceVerifyResultRequest;
import com.cxso.example.request.face.FaceVerifyTokenRequest;
import com.cxso.example.response.face.FaceVerifyResultResponse;
import com.cxso.example.response.face.FaceVerifyTokenResponse;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "人脸识别服务")
public class FaceClient extends Client {

    public FaceClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "获取H5人脸识别地址")
    public Result<FaceVerifyTokenResponse> faceVerifyToken(FaceVerifyTokenRequest faceVerifyTokenRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/face/operateFaceVerifyToken", HttpMethod.POST, faceVerifyTokenRequest).toEntity(FaceVerifyTokenResponse.class);
    }

    @Schema(description = "人脸识别结果")
    public Result<FaceVerifyResultResponse> faceVerifyResult(FaceVerifyResultRequest faceVerifyResultRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/face/operateFaceVerifyResult", HttpMethod.POST, faceVerifyResultRequest).toEntity(FaceVerifyResultResponse.class);
    }

}
